package com.yinuo.repository;

import com.yinuo.entity.JavaCommonClass;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * linux文档仓库类
 */
public interface JavaRepository extends JpaRepository<JavaCommonClass,String>{

    //复杂查询
    List<JavaCommonClass> findAll(Specification<JavaCommonClass> spec);

    @Modifying
    @Query(value = "update JAVA_COMMON_CLASS t set t.desc = ?2 where t.id = ?1",nativeQuery = true)
    int updateDesc(String id,String value);
}
